package com.bsj.power.common.def.vo.pls.httpVo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author yinhao
 * @version 1.0
 * @description 简化位置点
 * @date 2024/11/1
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class SimplifyPos {

    /**
     * 标签所在地图
     */
    private int mapId;

    /**
     * 将数据精简,只保留2位小数点
     */
    private double[] reducePos;

    /**
     * 标签序列号（设备号）
     */
    private String sn;
    /**
     * 时间 单位ms
     */
    private long time;
    /**
     * x|y拼接到一起，用于过滤
     */
    private String posStr;

    public void sp(HttpTagPosVO vo) {
        this.mapId = vo.getMapId();
        this.reducePos = vo.getReducePos();
        this.sn = vo.getSn();
        this.time = vo.getTime();
        double[] reducePos = vo.getReducePos();
        this.posStr = reducePos[0] + "|" + reducePos[1];
    }

}
